﻿using System;

namespace BSharp.Compiler.Emit
{
	public class AddressOf : IntermediateInstruction
	{
		public readonly int Local;
		public readonly int Dest;
		public AddressOf (int dest, int reg)
		{
			Local = reg;
			Dest = dest;
		}

		public override void Visit (IntermediateCompiler compiler)
		{
			compiler.Compile (this);
		}

		public override string ToString ()
		{
			return String.Format ("ADDRESS_OF r{0}, l{1}", Dest, Local);
		}
	}
}

